package com.heima.user.controller;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.AuthDto;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.user.service.IApUserRealnameService;
import java.util.List;
import java.util.Map;

import org.springframework.web.bind.annotation.RestController;

//实名认证
@RestController
@RequestMapping("/api/v1/user_realname")
@Api(tags = "APP实名认证信息表接口")
@CrossOrigin
public class ApUserRealnameController{

    @Autowired
    private IApUserRealnameService apUserRealnameService;

//    按照状态查询列表
@PostMapping(value = "/list",name = "根据状态分页查询实名认证信息")
public ResponseResult listByStatus(@RequestBody AuthDto dto){

    return apUserRealnameService.listByStatus(dto);
}

    @PostMapping(value = "/authPass",name = "实名认证通过")
    public ResponseResult authPass(@RequestBody AuthDto dto){
        return apUserRealnameService.auth(dto,1);  //1 代表通过
    }

    @PostMapping(value = "/authFail",name = "实名认证被驳回")
    public ResponseResult authFail(@RequestBody AuthDto dto){

        return apUserRealnameService.auth(dto,0); //0 代表驳回
    }
}
